﻿@model CourseSelectionStudent
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <script src="@Url.Content("~/js/jquery.min.js")" type="text/javascript"></script>
    <title>评价课程</title>
    <style type="text/css">
        body {
            margin: 0
        }

        .panel {
            background: #fff;
            padding: 0 20px;
        }

        .title {
            height: 50px;
            line-height: 50px;
            font-size: .25rem;
            border-bottom: 1px solid #eee;
        }

        .divider {
            height: 10px;
            background: #eee;
        }

        .row {
            height: 50px;
            line-height: 50px;
            font-size: .25rem;
        }

        .hd_2 {
            display: inline-block;
            width: 6rem;
            color: #999;
        }

        .hd_1 {
            color: #999;
            margin-right: 20px;
        }

        .hd {
            display: inline-block;
            width: 2rem;
            color: #999;
        }

        .sub-btn {
            margin: 0 auto;
            font-size: .3rem;
            background: #00A600;
            width: 5.2rem;
            height: .7rem;
            line-height: .7rem;
            color: #fff;
            border-radius: 5px;
            text-align: center;
        }

        .field-validation-error {
            color: red;
            text-align: center;
            font-size: .3rem;
        }

        .txt {
            padding: 10px 0;
            border-top: 1px solid #eee;
            font-size: .25rem;
            color: #999;
        }

        .star_1, .star_2, .star_3 {
            display: inline-block;
            background: url(./img/StarFull.png);
            width: .4rem;
            height: .4rem;
            background-size: 100% 100%;
            vertical-align: middle;
            margin-top: -.1rem;
        }
        /*		.star_1 {
            width: .34rem;
            height: .34rem;
        }*/
        .star_2 {
            background: url(./img/StarHalf.png);
            background-size: 100% 100%;
        }

        .star_3 {
            background: url(./img/StarEmpty.png);
            background-size: 100% 100%;
        }
    </style>

    <script type="text/javascript">

        $(function () {
            $("#SaveAndSend").click(function () {
                SaveAndSend();
            });
        });

        function SaveAndSend() {
            if ($.trim($("#Discipline").val()) == "") {
                $("#mes").html("请给课堂纪律打分！");
                return;
            }
            var disciplineScore = parseInt($.trim($("#Discipline").val()));
            if (isNaN(disciplineScore) || disciplineScore < 1 || disciplineScore > 10) {
                $("#mes").html("课堂纪律分数不符合规则，请重新打分！");
                return;
            }

            if ($.trim($("#Practical").val()) == "") {
                $("#mes").html("请给动手能力打分！");
                return;
            }
            var practicalScore = parseInt($.trim($("#Practical").val()));
            if (isNaN(practicalScore) || practicalScore < 1 || practicalScore > 10) {
                $("#mes").html("动手能力分数不符合规则，请重新打分！");
                return;
            }

            if ($.trim($("#Concentration").val()) == "") {
                $("#mes").html("请给专注力打分！");
                return;
            }
            var concentrationScore = parseInt($.trim($("#Concentration").val()));
            if (isNaN(concentrationScore) || concentrationScore < 1 || concentrationScore > 10) {
                $("#mes").html("专注力分数不符合规则，请重新打分！");
                return;
            }

            if ($.trim($("#Logic").val()) == "") {
                $("#mes").html("请给逻辑思维能力打分！");
                return;
            }
            var logicScore = parseInt($.trim($("#Logic").val()));
            if (isNaN(logicScore) || logicScore < 1 || logicScore > 10) {
                $("#mes").html("逻辑思维能力分数不符合规则，请重新打分！");
                return;
            }

            if ($.trim($("#Communication").val()) == "") {
                $("#mes").html("请给表达沟通能力打分！");
                return;
            }
            var communicationScore = parseInt($.trim($("#Communication").val()));
            if (isNaN(communicationScore) || communicationScore < 1 || communicationScore > 10) {
                $("#mes").html("表达沟通能力分数不符合规则，请重新打分！");
                return;
            }

            if ($.trim($("#Evaluation").val()) == "") {
                $("#mes").html("请填写评论内容！");
                return;
            }
            //---------------------------------------------------------------------
            $.post('/SaveAndSendEvaluate', { selectionStudentId: @(Model.SelectionStudentID), disciplineScore: disciplineScore, practicalScore: practicalScore, concentrationScore: concentrationScore, logicScore: logicScore, communicationScore: communicationScore, evaluation: $.trim($("#Evaluation").val()) },
                function (data) {
                    if (data.resultCode == "0") {
                        window.location = "http://www.yqhaba.com/Jump?returnUrl=EvaluateList";
                    } else {
                        $("#mes").html(data.resultMsg);
                    }
                }, "json");
            return false;
        };


        (function () {
            var docEl = document.documentElement;
            var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
            var recalc = function () {
                var clientWidth = docEl.clientWidth;
                if (!clientWidth) return;
                if (clientWidth >= 640) {
                    docEl.style.fontSize = '100px';
                } else {
                    docEl.style.fontSize = 100 * (clientWidth / 640) + 'px';
                }
            };
            if (!document.addEventListener) return;
            window.addEventListener(resizeEvt, recalc, false);
            document.addEventListener('DOMContentLoaded', recalc, false);
            recalc();
        })()
    </script>
</head>
<body>
	<div class="panel">
		<div class="title">上课详情</div>
		<div class="row">
			<span class="hd_1">课程</span>
			<span>@Model.Selection.Course.CourseName</span>
		</div>
		<div class="row">
			<span class="hd_1">老师</span>
			<span>@Model.Selection.Teacher.TeacherName</span>
		</div>
		<div class="row">
			<span class="hd_1">日期</span>
			<span>@Model.Selection.CourseDate.ToString("yyyy-MM-dd")</span>
		</div>
	</div>
	<div class="divider"></div>
    <div class="panel">
        <div class="title">老师点评</div>
        <div class="row">
            <span class="hd_1">课堂纪律</span>
            <span>
                <input id="Discipline" name="Discipline" type="text" placeholder="请输入1-10的数字" value="10" />
            </span>
        </div>
        <div class="row">
            <span class="hd_1">动手能力</span>
            <span>
                <input id="Practical" name="Practical" type="text" placeholder="请输入1-10的数字" value="10" />
            </span>
        </div>
        <div class="row">
            <span class="hd_1">专注力</span>
            <span>
                <input id="Concentration" name="Concentration" type="text" placeholder="请输入1-10的数字" value="10" />
            </span>
        </div>
        <div class="row">
            <span class="hd_1">逻辑思维能力</span>
            <span>
                <input id="Logic" name="Logic" type="text" placeholder="请输入1-10的数字" value="10" />
            </span>
        </div>
        <div class="row">
            <span class="hd_1">表达沟通能力</span>
            <span>
                <input id="Communication" name="Communication" type="text" placeholder="请输入1-10的数字" value="10" />
            </span>
        </div>
        <div>
            <span>
                <textarea id="Evaluation" name="Evaluation" rows="5" class="ipt" placeholder="请输入评价内容" value="" style="width:100%"></textarea>
            </span>
        </div>
        <div class="sub-btn" id="SaveAndSend">
            保存并推送
        </div>
        <div id="mes" class="field-validation-error"></div>
    </div>
</body>
</html>
